package cn.fanyc.action.spring.cloud.action02.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * 请求客户端
 *
 * @author Fanyc
 * @date 2019/12/10 22:40
 */
@RestController
@RequestMapping("/call")
public class CallController {

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("getUserInfo")
    public String getUserInfo() {
        return restTemplate.getForObject("http://UserProvider/v1/user/1001", String.class);
    }
}
